package controller.gui.mainmenu;

import java.awt.Frame;
import java.awt.event.ActionEvent;

import javax.swing.JButton;

import controller.Controller;
import controller.NullStaticObjectException;
import controller.PrimaryButtonController;
import controller.StratumLevelUser;
import errors.DimensionNotAcceptableException;
import gui.Display;
import gui.MapEditorFrame;
import gui.StrataOverviewPanel;

public final class DownCurrentStrataWizardController extends PrimaryButtonController implements StratumLevelUser{

	private Display display;
	
	public DownCurrentStrataWizardController(JButton button,Display display) {
		super(button);
		this.display=display;
	}
	
	@Override
	public void wizardInizializer(ActionEvent arg0)throws NullStaticObjectException, DimensionNotAcceptableException {
		this.setToIdle();
		if (this.stratum.getValue()==this.NOCURRENTSTRATUM){//non ci sono ancora strati disponibili
			return;
		}
		if (this.stratum.getValue()==0){//siamo in fondo
			return;
		}
		this.stratum.setValue(this.stratum.getValue()-1);
		this.display.repaint();
	}

}
